
import java.util.Scanner;
public class Test30{
  public static void main(String[] args){
    Scanner scanner=new Scanner(System.in);
    String input=scanner.nextLine();
    int lowerCount=0;
    int upperCount=0;
    int digitCount=0;
    int otherCount=0;
    for(int i=0;i<input.length();i++){
      char ch=input.charAt(i);
      if(Character.isLowerCase(ch)){
        lowerCount++;
      }else if(Character.isUpperCase(ch)){
        upperCount++;
      }else if(Character.isDigit(ch)){
        digitCount++;
      }else{
        otherCount++;
      }
    }System.out.println(lowerCount+" "+upperCount+" "+digitCount+" "+otherCount);
    scanner.close();
  }
}